package com.idealighter.game.log.struct.game;

import com.idealighter.game.dblog.annotation.Column;
import com.idealighter.game.dblog.annotation.LogTable;
import com.idealighter.game.dblog.core.TableType;
import com.idealighter.game.games.doudizhu.struct.DouDiZhuMatch;
import com.idealighter.game.games.doudizhu.struct.DouDiZhuRoom;
import com.idealighter.game.log.core.PlayerLog;
import com.idealighter.game.player.service.bo.PlayerBo;

@LogTable(type = TableType.DAY)
public class DouDiZhuMatchLog extends PlayerLog {

  @Column(type = "bigint", size = 20, remark = "房间id")
  public final long roomId;
  @Column(type = "varchar", size = 64, remark = "房间名称")
  public final String roomName;
  @Column(type = "int", size = 11, remark = "比赛id")
  public final int matchId;
  @Column(type = "int", size = 11, remark = "比赛类型")
  public final int matchType;
  @Column(type = "int", size = 11, remark = "比赛规定人数")
  public final int matchNum;
  @Column(type = "bigint", size = 20, remark = "比赛开始时间")
  public long matchTime;
  @Column(type = "int", size = 11, remark = "名次")
  public final int rank;
  @Column(type = "varchar", size = 512, remark = "奖励")
  public final String reward;

  /**
   * 构造函数.
   * 
   * @param playerDom .
   * @param match .
   * @param rank .
   * @param reward .
   */
  public DouDiZhuMatchLog(PlayerBo playerDom, DouDiZhuMatch match, int rank, String reward) {
    super(playerDom);
    DouDiZhuRoom room = match.room;
    this.roomId = room.getId();
    this.roomName = room.getName();
    this.matchId = match.id;
    this.matchType = match.type;
    this.matchNum = match.matchNum;
    this.matchTime = match.matchTime;
    this.rank = rank;
    this.reward = reward;
  }

}
